Source for file SC_Initial.php
Documentation is available at SC_Initial.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* @author LOCKON CO.,LTD.
* @version $Id: SC_Initial.php 21305 2011-10-31 05:02:04Z kotani $
define('ECCUBE_VERSION', '2.11.4');
* 初期設定ファイルを読み込み, パスの設定を行う.
require_once CONFIG_REALFILE;
DB_TYPE . "://" . DB_USER . ":" . DB_PASSWORD . "@"
. DB_SERVER . ":" . DB_PORT . "/" . DB_NAME);
* 運用時 - E_ALL & ~E_NOTICE
* TODO SJIS-win や, eucJP-win への対応
ini_set('mbstring.http_input', CHAR_CODE);
ini_set('mbstring.http_output', CHAR_CODE);
ini_set('auto_detect_line_endings', 1);
ini_set('default_charset', CHAR_CODE);
ini_set('mbstring.internal_encoding', CHAR_CODE);
ini_set('mbstring.detect_order', 'auto');
ini_set('mbstring.substitute_character', 'none');
mb_language('ja'); // mb_internal_encoding() より前に
// TODO 他に mb_language() している箇所の削除を検討
// TODO .htaccess の mbstring.language を削除できないか検討
mb_internal_encoding(CHAR_CODE); // mb_language() より後で
// TODO 上の「ini_set('mbstring.internal_encoding', CHAR_CODE);」を削除できないか検討
// TODO .htaccess の mbstring.internal_encoding を削除できないか検討
ini_set('arg_separator.output', '&');
// TODO: Windows上のロケール設定が正常に働かない場合があることに暫定的に対応
// ''を指定するとApache実行環境の環境変数が使われる
// See also: http://php.net/manual/ja/function.setlocale.php
* 定数 DIR_INDEX_PATH を設定する.
// DirectoryIndex の実ファイル名
define('DIR_INDEX_FILE', 'index.php');
$useFilenameDirIndex = is_bool(USE_FILENAME_DIR_INDEX)
: (isset ($_SERVER['SERVER_SOFTWARE']) ? substr($_SERVER['SERVER_SOFTWARE'], 0, 13) == 'Microsoft-IIS' : false)
// DIR_INDEX_FILE にアクセスする時の URL のファイル名部を定義する
if ($useFilenameDirIndex === true) {
define('DIR_INDEX_PATH', DIR_INDEX_FILE);
* mtb_constants.php を読み込んで定数を設定する.
* キャッシュディレクトリに存在しない場合は, 初期データからコピーする.
= '<div style="color: #F00; font-weight: bold; background-color: #FEB; text-align: center">'
. ' にユーザ書込み権限(777等)を付与して下さい。</div>';
if (is_file(CACHE_REALDIR . "mtb_constants.php")) {
require_once CACHE_REALDIR . 'mtb_constants.php';
// キャッシュが無ければ, 初期データからコピー
} elseif (is_file(CACHE_REALDIR . "../mtb_constants_init.php")) {
$handle = fopen(CACHE_REALDIR . "mtb_constants.php", 'w');
if (fwrite($handle, $mtb_constants) === false) {
require_once CACHE_REALDIR . 'mtb_constants.php';
die(CACHE_REALDIR . "../mtb_constants_init.php が存在しません");
* ソースのみ差し替えたバージョンアップを考慮したもの。
/** 郵便番号CSVのZIPアーカイブファイルの取得元 */
$this->defineIfNotDefined('ZIP_DOWNLOAD_URL', "http://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip");
* Smarty キャッシュディレクトリを生成する.
mkdir(MOBILE_COMPILE_REALDIR);
mkdir(SMARTPHONE_COMPILE_REALDIR);
mkdir(COMPILE_ADMIN_REALDIR);
define('PRODUCT_NOT_FOUND', 1);
define('CATEGORY_NOT_FOUND', 6);
define('SITE_LOGIN_ERROR', 7);
define('TEMP_LOGIN_ERROR', 12);
define('FTP_DOWNLOAD_ERROR', 15);
define('FTP_LOGIN_ERROR', 16);
define('FTP_CONNECT_ERROR', 17);
define('CREATE_DB_ERROR', 18);
define('DB_IMPORT_ERROR', 19);
define('WRITE_FILE_ERROR', 21);
define('DB_CONNECT_ERROR', 22);
define('FREE_ERROR_MSG', 999);
// LC_Page_Error_DispError用
define('INVALID_MOVE_ERRORR', 4);
* クォートされた文字列のクォート部分を再帰的に取り除く.
* {@link http://jp2.php.net/manual/ja/function.get-magic-quotes-gpc.php PHP Manual} の記事を参考に実装。
* $_REQUEST は後続の処理で再構成されるため、本処理では外している。
* この関数は, PHP5以上を対象とし, PHP4 の場合は何もしない.
// Strip magic quotes from request data.
// Create lamba style unescaping function (for portability)
$unescape_function = (empty($quotes_sybase) || $quotes_sybase === 'off') ? 'stripslashes($value)' : 'str_replace("\'\'","\'",$value)';
$value = ' . $unescape_function . ';
} else if (is_array($value)) {
foreach ($value as &$v) $fn($v, $fn);
$stripslashes_deep($_POST, $stripslashes_deep);
$stripslashes_deep($_GET, $stripslashes_deep);
$stripslashes_deep($_COOKIE, $stripslashes_deep);
* スーパーグローバル変数「$_REQUEST」を再セット
* variables_order ディレクティブによる差を吸収する。
* 指定された名前の定数が存在しない場合、指定された値で定義
* @param string $name 定数の名前。
* @param mixed $value 定数の値。
Documentation generated on Fri, 24 Feb 2012 14:02:50 +0900 by Seasoft
|